<!--
 * @Author: 白印潇 bai_yinxiao@163.com
 * @Date: 2023-03-17 15:50:09
 * @LastEditors: 白印潇 bai_yinxiao@163.com
 * @LastEditTime: 2023-03-17 16:49:00
 * @FilePath: /shortRent-ui/src/views/components/memberCreditRecord.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div>
    <el-table v-loading="loading" :data="basicList" stripe
      :header-cell-style="{ background: '#eef1f6', color: '#606266' }" border>
      <template slot="empty">
        <el-empty :image-size="50" description="暂无反欺诈查询记录"></el-empty>
      </template>
      <el-table-column label="提交人" align="center" prop="createUserName" />
      <el-table-column label="查询时间" align="center" prop="queryTime" />
      <el-table-column label="查询结果" align="center">
        <template v-slot="{ row }">
          <span v-if="row.abnormalCount != null && row.abnormalCount > 0" style="color: red;">
            {{ row.abnormalCount }}项异常
          </span>
          <span v-else style="color: green;">
            正常
          </span>
        </template>
      </el-table-column>
    <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160">
      <template slot-scope="scope">
        <el-button size="mini" type="text" @click="handleDetail(scope.row)">查看</el-button>
        </template>
      </el-table-column>
    </el-table>

    <!-- <div v-show="total > 0" style="background-color: #fff;padding-bottom: 10px; margin-top: 10px;">
                      <pagination :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
                        @pagination="getList" />
                    </div> -->
  </div>
</template>
<script>
import * as creditApi from "@/api/credit/credit"
export default {
  props: {
    memberNo: {
      type: String,
      default: '',
    }
  },
  data() {
    return {
      loading: false,
      total: 0,
      // 征信记录数据
      basicList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 100,
        memberNo: ''
      }
    }
  },
  mounted() {
    this.$nextTick(() => {
      console.log('客户编号>>>', this.memberNo);
      this.queryParams.memberNo = this.memberNo;
      this.getList();
    })
  },
  created() {


  },
  methods: {
    /** 查询征信工单列表 */
    getList() {
      this.loading = true
      creditApi.creditWorkList(this.queryParams).then(res => {
        this.basicList = res.rows;
        this.loading = false
      }).catch(() => {
        this.loading = false
      })
    },
    // 查看
    handleDetail(item) {
      this.$router.push({ name: 'creditDetail', query: { id: item.id } });
    },
  },
}
</script>
<style lang="">

</style>
